<?php

use think\migration\Migrator;
use think\migration\db\Column;

class SupplierGoodsAgreement extends Migrator
{
    /**
     * Change Method.
     *
     * Write your reversible migrations using this method.
     *
     * More information on writing migrations is available here:
     * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
     *
     * The following commands can be used in this method and Phinx will
     * automatically reverse them when rolling back:
     *
     *    createTable
     *    renameTable
     *    addColumn
     *    renameColumn
     *    addIndex
     *    addForeignKey
     *
     * Remember to call "create()" or "update()" and NOT "save()" when working
     * with the Table class.
     */
    public function change()
    {
//        $this->table('supplier_goods_agreement', ['comment' => '供应商商品协议表'])
//             ->addColumn('company_id', 'integer', ['limit' => 11, 'default' => 0, "after" => 'id', 'comment' => '公司ID'])
//             ->addColumn('supplier_id', 'integer', ['limit' => 11, 'default' => 0, "after" => 'company_id', 'comment' => '供应商ID'])
//             ->addColumn('goods_id', 'integer', ['limit' => 11, 'default' => 0, "after" => 'supplier_id', 'comment' => '商品ID'])
//             ->addColumn('goods_rule_id', 'integer', ['limit' => 11, 'default' => 0, "after" => 'goods_id', 'comment' => '商品规格ID'])
//             ->addColumn('set_num', 'integer', ['limit' => 11, 'default' => 0, "after" => 'goods_rule_id', 'comment' => '起订数'])
//             ->addColumn('give_num', 'integer', ['limit' => 11, 'default' => 0, "after" => 'set_num', 'comment' => '赠送数'])
//             ->addColumn('money', 'decimal', ['precision' => 10, 'scale' => 2, 'default' => 0, "after" => 'give_num', 'comment' => '协议价'])
//             ->addColumn('original_money', 'decimal', ['precision' => 10, 'scale' => 2, 'default' => 0, "after" => 'money', 'comment' => '原价'])
//             ->addColumn('name', 'string', ['limit' => 50, 'default' => '', "after" => 'original_money', 'comment' => '协议名称'])


//             ->addColumn('no', 'string', ['limit' => 50, 'default' => '', "after" => 'name', 'comment' => '协议编号'])
//             ->addColumn('start_time', 'datetime', ['default' => null, "after" => 'no', 'comment' => '协议开始时间'])
//             ->addColumn('end_time', 'datetime', ['default' => null, "after" => 'start_time', 'comment' => '协议结束时间'])
//             ->addColumn('operator', 'string', ['limit' => 50, 'default' => '', "after" => 'end_time', 'comment' => '经办人'])
//             ->addColumn('store_id', 'integer', ['limit' => 11, 'default' => 0, "after" => 'operator', 'comment' => '门店(客户)'])
//             ->addColumn('is_exchange', 'integer', ['limit' => 1,'default' => 0, "after" => 'store_id', 'comment' => '是否兑换'])
//             ->addColumn('audit_status', 'integer', ['limit' => 1,'default' => 1, "after" => 'is_exchange', 'comment' => '审核状态 1:待审核 2:审核通过 3:审核不通过'])
//             ->addColumn('type', 'integer', ['limit' => 1,'default' => 1, "after" => 'audit_status', 'comment' => '协议类型 1:陈列费 2:预售款'])
//             ->create();
    }
}
